const Http = require('./http');
const Api= require('./api');

class PhoneService {
  static getVerifyCode(phone,openid) {
    return Http.request({
      url: Api.getVerifyCode,
      data: {
        phone: phone,
        openid: openid
      }
    });
  }

  static verifyCode(phone,code,openid,mid) {
    var params = {
      phone: phone,
      code: code,
      openid: openid
    };
    if(mid) {
      params.mid = mid;
    }
    return Http.request({
      url: Api.verifyCode,
      data: params
    });
  }
  
}
module.exports = PhoneService;